package  
{
	import org.flixel.FlxEmitter;
	import org.flixel.FlxGroup;
	import org.flixel.FlxParticle;
	import org.flixel.FlxSprite;
	/**
	 * ...
	 * @author Billy Kaifer
	 */
	public class FX extends FlxGroup
	{
		private var pixels:FlxGroup;
		
		public function FX() 
		{
			super();
			pixels = new FlxGroup();
			
			for (var i:int = 0; i < 30; i++) {
				var tempPixel:FlxEmitter = new FlxEmitter();
				for (var j:int = 0; j < 10; j++) {
					var particle:FlxParticle = new FlxParticle();
					particle.makeGraphic(2, 2, 0xFFFF8C00);
					tempPixel.add(particle);
				}
				pixels.add(tempPixel);
			}
			add(pixels);
		}
		
		public function explode(_x:int, _y:int):void {
			var pixel:FlxEmitter = (pixels.getFirstAvailable() as FlxEmitter);
			
			if (pixel) {
				pixel.x = _x;
				pixel.y = _y;
				pixel.start(true, 2);
			}
		}
	}

}